//
//  constant.swift
//  PTool
//
//  Created by JKSD on 2019/7/17.
//  Copyright © 2019 KID. All rights reserved.
//

import UIKit
//适配不同屏幕尺寸
//#define kScreenWidthRatio  (Screen_Width / 375.0)
////iphoneX的宽度与6s相等，所以iphoneX 的高度适配比例使用6s的比例
//#define kScreenHeightRatio (Screen_Width==375 ? 1:(Screen_Height / 667.0))
//#define AdaptedWidth(x)  ceilf((x) * kScreenWidthRatio)
//#define AdaptedHeight(x) ceilf((x) * kScreenHeightRatio)
//#define kFontSize(R)     [UIFont systemFontOfSize:AdaptedWidth(R)]
//#define kBlodFontSize(R) [UIFont boldSystemFontOfSize:AdaptedWidth(R)]

public let SCREEN_WIDTH = UIScreen.main.bounds.size.width
public let SCREEN_HEIGHT = UIScreen.main.bounds.size.height
public let kScreenWidthRatio = SCREEN_WIDTH/375.0
public let kScreenHeightRatio = (SCREEN_WIDTH == 375 ? 1 : (SCREEN_HEIGHT / 667.0))
public let STABARH = UIApplication.shared.statusBarFrame.size.height





public class constant: NSObject {

    
    
  public  static  func AdaptedWidth(x:CGFloat) -> CGFloat {
        let width = ceil(x * kScreenWidthRatio)
        return width
    }
    
    public static func AdaptedHeight(x:CGFloat) -> CGFloat{
        let height = ceil(x * kScreenHeightRatio)
        return height
    }
    
    public static func kFontSize(x:CGFloat) -> UIFont{
        let height = UIFont.systemFont(ofSize: AdaptedWidth(x: x))
        return height
    }
    
    public static func kBlodFontSize(x:CGFloat) -> UIFont{
        let height = UIFont.boldSystemFont(ofSize: x)
        return height
    }
}


